import request from "@/utils/request";

// 查询试题列表
export function listPaper(params) {
  return request({
    url: "/project/bank/list",
    method: "get",
    params,
  });
}

// 导入试题
export function excelImport(data) {
  return request({
    url: `project/bank/excelImport`,
    method: "post",
    data
  });
}
export function wordImport(data) {
  return request({
    url: `project/bank/wordImport`,
    method: "post",
    data
  });
}
// 新增试题
export function addPaper(data) {
  return request({
    url: `project/bank`,
    method: "post",
    data
  });
}
// 编辑试题
export function updatePaper(data) {
  return request({
    url: `project/bank`,
    method: "put",
    data
  });
}
// 删除试题
export function delePaper(id) {
  return request({
    url: `project/bank/${id}`,
    method: "delete"
  });
}
// 试题详情
export function detailPaper(id) {
  return request({
    url: `project/bank/${id}`,
    method: "get",
  });
}
// 自动组卷
export function generatePaper(data) {
  return request({
    url: '/project/paper/generatePaper',
    method: "post",
    data
  });
}
// 柱状图数据
export function quizAllScore(params) {
  return request({
    url: '/test/paper/user/quizAllScore',
    method: "get",
    params
  });
}
// 获取已发布试卷
export function paperList(params) {
  return request({
    url: '/project/paper/list',
    method: "get",
    params
  });
}
// 获取试卷详情
export function getTestInfo(data) {
  return request({
    url: '/test/paper/user/getTestPaperInfo',
    method: "post",
    data
  });
}
// 撤回
export function modifyStatus(data) {
  return request({
    url: '/project/paper',
    method: "put",
    data
  });
}
// 删除
export function modifyDelete(id) {
  return request({
    url: `/project/paper/${id}`,
    method: "delete",
  });
}
// 数据概览
export function getQuizAll(params) {
  return request({
    url: `/test/paper/user/quizAll`,
    method: "get",
    params
  });
}
// 学院数据
export function getQuizXy(params) {
  return request({
    url: `/test/paper/user/quizXy`,
    method: "get",
    params
  });
}
// 专业数据
export function getQuizZy(params) {
  return request({
    url: `/test/paper/user/quizZy`,
    method: "get",
    params
  });
}
// 班级数据
export function getQuizBj(params) {
  return request({
    url: `/test/paper/user/quizBj`,
    method: "get",
    params
  });
}
// 学生数据
export function getQuizXs(params) {
  return request({
    url: `/test/paper/user/quizXs`,
    method: "get",
    params
  });
}
// 学生答题详情
export function getPaperInfo(params) {
  return request({
    url: `/test/paper/user/getTestPaperInfoAnswer`,
    method: "get",
    params
  });
}

// 试卷详情
export function detail(id) {
  return request({
    url: `/test/paper/user/${id}`,
    method: "GET",
  });
}
// 重做
export function redoPaper(id) {
  return request({
    url: `/test/paper/user/${id}`,
    method: "delete",
  });
}
